package com.xiangge.zuoye;

import java.util.Scanner;

public class Demo4 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入一个[1-9]之间的整数：");
        int n = input.nextInt();
        if (n<1||n>9){
            System.err.println("数据不合法");
        }
        getChengfa(n);
    }

    public static void getChengfa(int n) {

        for (int i = 1; i <= 9; i++) {
            for (int j = 1; j <= i; j++) {
                System.out.print(i+"*"+j+"="+(i*j)+" ");
            }
            if (i==4){
                break;
            }
            System.out.println();
        }

    }
}
